/**
 * class  BaseGroup
 * 群组基类
 * author haicent
 * email haicent@126.com
 * version 0.01
 */
package as3.component.support
{
	import flash.events.EventDispatcher;
	
	import as3.component.Component;

	public class BaseGroup extends EventDispatcher
	{
		//元件列表
		protected var _list:Array;
		public function BaseGroup()
		{
			_list = new Array();
		}
		
		/**
		 *  添加组件 
		 * @param item
		 * 
		 */		
		public function put(item:Component):void
		{
			if (_list == null) _list = new Array();
			_list.push(item);
		}
		
		/**
		 * 移除组件 
		 * @param item
		 * 
		 */		
		public function remove(item:Component):void
		{
			if (_list ==  null || item == null) return;
			var index:int = _list.indexOf(item);
			if (index > -1)
			{
				_list.splice(index, 1);
			}
		}
		
		/**
		 * 获得组件列表
		 * @return 
		 * 
		 */		
		public function get list():Array
		{
			return _list;
		}
		
		public function unSelectAll():void
		{
			
		}
		
		/**
		 *清除组 
		 * 
		 */		
		public function clear():void
		{
			_list = null;
		}
	}
}